#pragma once


#include "HashTable.h"

namespace czb {

	template<class K,class V, class Hash = HashFunc<K>>
	class unordered_map
	{
	public:

		struct MapKeyOfT
		{
			const K& operator()(const pair<const K, V>& kv)
			{
				return kv.first;
			}
		};


		typedef typename HashTable <K, pair<const K, V>, MapKeyOfT, Hash>::Iterator Iterator;
		bool Insert(const pair<const K, V>& kv)
		{
			return _h.Insert(kv);
		}

		Iterator begin()
		{
			return _h.begin();
		}

		Iterator end()
		{
			return _h.end();
		}

	private:
		HashTable<K, pair<const K, V>,  MapKeyOfT, Hash> _h;
	};
}